Skip to content

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#39

Merged
nstarman merged 1 commit into
mainfrom
alert-autofix-3
Nov 1, 2025
Merged

Potential fix for code scanning alert no. 3: Workflow does not contain permissions#39
nstarman merged 1 commit into
mainfrom
alert-autofix-3

Conversation

@nstarman
Copy link
Copy Markdown
Contributor

@nstarman nstarman commented Nov 1, 2025

Potential fix for https://github.com/GalacticDynamics/optional_dependencies/security/code-scanning/3

To fix the issue, explicitly set the permissions block for the checks job to limit the GitHub token's scope to only what is minimally required. Based on this workflow, the job requires only read access to repository contents for checkout, test, and uploading code coverage, so contents: read is sufficient.
Specifically, add the following lines under the checks: job at the same indentation level as runs-on: and above steps:, matching how the pre-commit job is already structured. No additional imports or definitions are needed—just the addition of the permissions block in .github/workflows/ci.yml.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…n permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Nathaniel Starkman <nstarman@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d91a995) to head (f876041).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #39   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           82        82           
=========================================
  Hits            82        82           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nstarman nstarman marked this pull request as ready for review November 1, 2025 19:37
@nstarman nstarman merged commit 5e90c91 into main Nov 1, 2025
17 of 18 checks passed
@nstarman nstarman deleted the alert-autofix-3 branch November 1, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant